package cn.tannn.cat.file.server.entity;


import cn.tannn.cat.file.server.enums.DictStatus;
import cn.tannn.cat.file.server.enums.DictType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

/**
 * 字典
 *
 * @author <a href="https://tannn.cn/">tan</a>
 * @date 2024/3/7 11:32
 */
@Entity
@Table(name = "sys_dict")
@Comment("字典")
@Getter
@Setter
@ToString
@DynamicUpdate
@DynamicInsert
public class Dict extends CommonBean<Dict> {

    /**
     * 字典标签
     */
    @Comment("字典标签")
    @Column(columnDefinition = "varchar(100) not null")
    private String label;

    /**
     * 字典键值
     */
    @Comment("字典键值")
    @Column(columnDefinition = "varchar(100)  not null")
    private String value;

    /**
     * 字典类型
     * @see DictType
     */
    @Comment("字典类型")
    @Column(columnDefinition = "varchar(100)  not null")
    private DictType dictType;

    /**
     * 状态
     * @see DictStatus
     */
    @Comment("状态[0停用 1启用]")
    @Column(columnDefinition = "int default 1")
    private DictStatus status;

    /**
     * 排序[小在前]
     */
    @Comment("排序[小在前]")
    @Column(columnDefinition = "int default 999")
    private Integer sort;

    /**
     * 备注
     */
    @Comment("备注")
    @Column(columnDefinition = "varchar(100)")
    private String remark;

}
